package com.mjk.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.mjk.common.vo.TreeNode;

public class AuthorityMenuTree extends TreeNode implements Serializable{

	String text;
	String icon;
	List<AuthorityMenuTree> list = new ArrayList<AuthorityMenuTree>();
	
	public AuthorityMenuTree(String text, List<AuthorityMenuTree> list){
		this.text = text;
		this.list = list;
	}
	
	public AuthorityMenuTree() {
    }
	
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}

	public List<AuthorityMenuTree> getList() {
		return list;
	}

	public void setList(List<AuthorityMenuTree> list) {
		this.list = list;
	}

	@Override
	public void setChildren(List<TreeNode> children) {
		// TODO Auto-generated method stub
		super.setChildren(children);
		list = new ArrayList<AuthorityMenuTree>();
	}

	@Override
	public void add(TreeNode node) {
		// TODO Auto-generated method stub
		super.add(node);
		AuthorityMenuTree temp = new AuthorityMenuTree();
		BeanUtils.copyProperties(node, temp);
		node.add(temp);
	}
	
}
